setInterval(function () {
    console.log("background running ...")

    chrome.tabs.query({}, function (tabs) {
        for (let i = 0; i < tabs.length; i++) {
            const tab = tabs[i]
            if (tab.url.indexOf("www.maersk.com") != -1) {
                chrome.tabs.sendMessage(tab.id, {
                    type: 'telemetry'
                }, function (response) {
                    console.log("background rev response: " + response)
                });
            }
        }
    });
}, 3000)

let domain = "maersk.com"
setInterval(function () {
    chrome.tabs.query({}, async function (tabs) {
        for (let i = 0; i < tabs.length; i++) {
            const tab = tabs[i]
            if (tab.url.indexOf(domain) != -1) {
                chrome.tabs.update(tab.id, {url: 'https://www.maersk.com.cn/'});
                // chrome.tabs.reload(tabs[0].id);
            }
        }
    });
}, 60000 * 2)